import React from 'react'
import {useParams,useNavigate,useLocation} from "react-router-dom"

function withRouter(Com) {
    return (props)=>{
        const params = useParams()
        const location = useLocation()
        const navigate = useNavigate()
        return <Com {...props} router={{params,location,navigate}}/>
    }
}

export default withRouter
